<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>

		<link rel="stylesheet" href="__CSS__/style.css?t=1">
		<link rel="stylesheet" type="text/css" href="__CSS__/mingxi.css">
		<link rel="stylesheet" type="text/css" href="__CSS__/date.css">


	</head>
	<body>

		<div class="title_div">
			<div class="fanhui">
				<a href="javascript:history.back(-1)">
					<img src="__IMGS__/fanhui.png" />
				</a>

			</div>
			<h1>帐变明细</h1>
		</div>
		<div class="setdate_div">
			<ul>
				<li><span>起始时间</span><input type="text" id="start_time" readonly="readonly"  value="" style="cursor: pointer;"></li>
				<li><span>结束时间</span><input type="text" id="end_time" readonly="readonly"  value="" style="cursor: pointer;"></li>
				<li class="chaxun"><button>查询</button></li>
			</ul>
		</div>
		<div class="rizhi_div">
			<ul class="tit">
				<li>类型</li>
				<li>帐变金额</li>
				<li>操作时间</li>
			</ul>
		</div>
		<div class="rizhi_div_list">
			<!--<ul>-->
				<!--<li>亏损</li>-->
				<!--<li class="kui">-200000</li>-->
				<!--<li>2019-10-10</li>-->
			<!--</ul>-->
		</div>
		<p class="zongji">总计：00</p>
		<!-- 日期容器 -->
		<div id="datePlugin"></div>

		<script type="text/javascript" src="__JS__/jquery.min.js"></script>
		<script type="text/javascript" src="__JS__/date.js"></script>
		<script type="text/javascript" src="__JS__/iscroll_date.js"></script>
		<script src="__JS__/mui.min.js"></script>
		<script>
			setInterval(function(){
				location.reload();
			},20000);
			//初始化日期插件
			$('#start_time').date();
			$('#end_time').date();
			mui.init({
				swipeBack: true //启用右滑关闭功能
			});
			var info = document.getElementById("login_but");
			$(".chaxun").on("click",function(){
				loads();
			});
			loads();
			function loads(){
				var that = this;
				mui.ajax({
					//几个参数需要注意一下
					type: "POST",//方法类型
					dataType: "json",//预期服务器返回的数据类型
					url: "{:url('/index/Home/mingxiInfo',[],true,true)}",//url
					data:{
						start_time:$("#start_time").val(),
						end_time:$("#end_time").val(),
					},
					success: function (result) {
						console.log(result);//打印服务端返回的数据(调试用)
						if (result.code == 1) {
							var html = "";
							$.each(result.data, function(index, value) {
								var c = "kui",f="-";
								if(value.ts==1){
									c="zhuan";
									f="+";
								}
								html+=
										'<ul>'+
										'<li>'+value.types+'</li>'+
										'<li class="'+c+'">'+f+value.s+'</li>'+
										'<li>'+value.ctime+'</li>'+
										'</ul>';
							});

							$(".rizhi_div_list").html(html);
							if(result.msg>=0){
								$(".zongji").html("总计：<span style='color:#2f9a4a '>+"+result.msg+"</span>");
							}else {
								$(".zongji").html("总计：<span style='color:#f5040 '>-"+result.msg+"</span>");
							}

							//window.location.href = result.url;
						}
					},
					error: function () {
						mui.alert('登录异常！');
						//alert("异常！");
					}
				});
			}

		</script>
	</body>
</html>
